﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;

namespace Session_Server.Controllers
{
    /// <summary>
    /// 控制器，基类
    /// </summary>
    public class BaseController : ApiController
    {
        public HttpContextBase GetHttpContext()
        {
            HttpContextBase context = (HttpContextBase)Request.Properties["MS_HttpContext"];//获取传统context
            return context;
        }
        public HttpRequestBase _Request
        {
            get
            {
                return GetHttpContext().Request;
            }
        }
        public HttpSessionStateBase _Session
        {
            get
            {
                return GetHttpContext().Session;
            }
        }
        public HttpApplicationStateBase _Application
        {
            get
            {
                return GetHttpContext().Application;
            }
        }
    }
}
